var app = new Vue({
  el: '#footer',
  data() {
    return {
      msg: 'footer',
      codeImages: [],
      companyLink: {
        mobile: 'xxx-xxxxxxxx',
        email: 'xxxxxxxx@xx.com',
        address: '深圳市龙华区民治街道民强社区向南三区东美大厦622',
        portal1: '粤公网安备*******ICP备*******号-**',
        protal2: '安全联盟行业验Copyright @2005-2018秒用软件版权所有'
      }
    }
  },
  created() {
    this.getContactInfo(), this.getrecordNo()
  },
  methods: {
    //获取联系详情
    getContactInfo() {
      axios
        .get('company/service/contact/findAll')
        .then(res => {
          var resdata = res.data.data[0]
          this.companyLink.mobile = resdata.contactMessage
          this.companyLink.email = resdata.email
          this.companyLink.address = resdata.address
          //封装二维码
          if (resdata.officialQrCode) {
            var officialQrCode = {
              codeImage: resdata.officialQrCode,
              name: '个人二维码'
            }
            this.codeImages[0] = officialQrCode
          }
          if (resdata.personalQrCode) {
            var personalQrCode = {
              codeImage: resdata.personalQrCode,
              name: '官方二维码'
            }
            this.codeImages[1] = personalQrCode
          }
        })
        .catch(err => {
          console.error(err)
        })
    },
    //获取备案号
    getrecordNo() {
      axios
        .get('user/service/userDomain/findAll')
        .then(res => {
          var resdata = res.data.data[0]
          this.companyLink.portal1 = resdata.recordNo
        })
        .catch(err => {
          console.error(err)
        })
    }
  }
})
